package com.definity.toolkit.web.taglib;

import javax.servlet.jsp.JspException;

public class CheckBoxTag extends ComponentFormTag {

	private static final long serialVersionUID = -6748931226218049805L;

	public CheckBoxTag() {

	}
	
	@Override
	protected String getComponentName() {
		return "checkbox";
	}

	@Override
	protected String createStartTag(String name, String id, Object value) throws JspException {
		return null;
	}

	@Override
	protected String createEndTag(String name, String id, Object value) throws JspException {
		String checked = "";
		Boolean checkedValue = (Boolean) value;
		if (checkedValue == Boolean.TRUE)
			checked = "checked=\"checked\"";
		return "<input type=\"checkbox\" id=\"" + id + "\" name=\"" + id + "\" " + createStyleClass() + " "  + checked + " />";
	}

}
